.class Lcom/instagram/android/b/w;
.super Lcom/instagram/android/d/k/d;
.source "SendAnalyticsRequest.java"


# instance fields
.field private final a:Ljava/lang/String;

.field private final b:Ljava/lang/String;

.field private final c:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter
    .parameter

    .prologue
    .line 27
    invoke-direct {p0}, Lcom/instagram/android/d/k/d;-><init>()V

    .line 28
    iput-object p1, p0, Lcom/instagram/android/b/w;->a:Ljava/lang/String;

    .line 29
    iput-object p2, p0, Lcom/instagram/android/b/w;->b:Ljava/lang/String;

    .line 30
    iput-object p3, p0, Lcom/instagram/android/b/w;->c:Ljava/lang/String;

    .line 31
    return-void
.end method

.method private static a(Ljava/lang/String;)Ljava/lang/String;
    .locals 3
    .parameter

    .prologue
    .line 67
    const-string v0, "UTF-8"

    invoke-static {p0, v0}, Lch/boye/httpclientandroidlib/util/EncodingUtils;->getBytes(Ljava/lang/String;Ljava/lang/String;)[B

    move-result-object v0

    .line 69
    new-instance v1, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v1}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 70
    new-instance v2, Ljava/util/zip/DeflaterOutputStream;

    invoke-direct {v2, v1}, Ljava/util/zip/DeflaterOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 71
    invoke-virtual {v2, v0}, Ljava/util/zip/DeflaterOutputStream;->write([B)V

    .line 72
    invoke-virtual {v2}, Ljava/util/zip/DeflaterOutputStream;->close()V

    .line 73
    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v0

    .line 74
    const/4 v1, 0x2

    invoke-static {v0, v1}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method public a()Lcom/instagram/android/d/b/a;
    .locals 1

    .prologue
    .line 35
    sget-object v0, Lcom/instagram/android/d/b/a;->a:Lcom/instagram/android/d/b/a;

    return-object v0
.end method

.method public b()Ljava/lang/String;
    .locals 1

    .prologue
    .line 40
    const-string v0, "https://api.facebook.com/method/logging.clientevent"

    return-object v0
.end method

.method public c()Lcom/instagram/android/d/b/c;
    .locals 4

    .prologue
    .line 45
    new-instance v1, Lcom/instagram/android/d/b/c;

    invoke-direct {v1}, Lcom/instagram/android/d/b/c;-><init>()V

    .line 47
    const-string v0, "method"

    const-string v2, "logging.clientevent"

    invoke-virtual {v1, v0, v2}, Lcom/instagram/android/d/b/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 50
    :try_start_0
    const-string v0, "message"

    iget-object v2, p0, Lcom/instagram/android/b/w;->a:Ljava/lang/String;

    invoke-static {v2}, Lcom/instagram/android/b/w;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v0, v2}, Lcom/instagram/android/d/b/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 51
    const-string v0, "compressed"

    const-string v2, "1"

    invoke-virtual {v1, v0, v2}, Lcom/instagram/android/d/b/c;->a(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 57
    :goto_0
    iget-object v0, p0, Lcom/instagram/android/b/w;->b:Ljava/lang/String;

    iget-object v2, p0, Lcom/instagram/android/b/w;->c:Ljava/lang/String;

    invoke-static {v1, v0, v2}, Lcom/instagram/android/d/i/d;->a(Lcom/instagram/android/d/b/c;Ljava/lang/String;Ljava/lang/String;)V

    .line 63
    return-object v1

    .line 52
    :catch_0
    move-exception v0

    .line 53
    const-string v2, "SendAnalyticsRequest"

    const-string v3, "Unable to compress upload payload"

    invoke-static {v2, v3, v0}, Lcom/facebook/e/a/a;->c(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 54
    const-string v0, "message"

    iget-object v2, p0, Lcom/instagram/android/b/w;->a:Ljava/lang/String;

    invoke-virtual {v1, v0, v2}, Lcom/instagram/android/d/b/c;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method
